package com.example.fasttask;

import java.util.Date;

public class Task {
	private String name;
	private int length;
	private Date dateCreated;
	private boolean isRecurring;
	private long id;
	private boolean isChecked;
	private boolean isDefault;
	
	public Task(String n, int len, Date date, boolean recur) {
		name = n;
		length = len;
		dateCreated = date;
		isRecurring = recur;
		isChecked = false;
		isDefault = false;
	}
	
	public String getName() {return name;}
	public int getLength() {return length;}
	public Date getDateCreated() {return dateCreated;}
	public boolean isRecurring() {return isRecurring;}
	public long getId() {return id;}
	public void setId(long inId) {id = inId;}
	public void setChecked(boolean checked) {isChecked = checked;}
	public boolean isChecked() {return isChecked;}
	public Task setDefault(boolean def) {isDefault = def; return this;}
	public boolean isDefault() {return isDefault;}
	
	public String toString() {
		String str = length + " min. - " + name;
		return str + ((isRecurring)? " (Recurring)": " (Not Recurring)"); 
	}
}